package com.itheima.controller.backend.security;

/*import com.itheima.pojo.User;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

*//**
 * @className CustomUserDetails
 *//*
public class CustomUserDetails implements UserDetails {
    private User user;
    public User getUser() {
        return user;
    }
    public CustomUserDetails(User user) {
        this.user = user;
    }

    // 用户是否可用，核心方法
    @Override
    public boolean isEnabled() {
        return true;
    }
    // 返回用户所拥有的权限集合
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return user.getAuthorities();
    }
    // 返回用户密码
    @Override
    public String getPassword() {
        return user.getPassword();
    }
    // 返回用户名
    @Override
    public String getUsername() {
        return user.getUsername();
    }
    //  返回用户是否未过期
    @Override
    public boolean isAccountNonExpired() {
        return true;
    }
    // 返回用户是否未锁定
    @Override
    public boolean isAccountNonLocked() {
        return true;
    }
    // 返回用户密码是否未过期
    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }


}*/
